{{include file="admin/intop.html"}}
<script type="text/javascript">
var closeListerner = function(){ window.location.reload(); }
function add(){
    showDialog("admin.php?ctl=sysmenu&act=add",420,320,"添加菜单", true, closeListerner);
}
function edit(id){
    showDialog("admin.php?ctl=sysmenu&act=edit&id="+id,420,320,"修改菜单", false, closeListerner);
}
</script>
<div class="toolsBar">
    <form id="form1" name="form1" method="post" action="admin.php?ctl=sysmenu">
        <input type="button" value="添加菜单" onclick="add()" class="button_style">
        &nbsp;&nbsp;&nbsp;&nbsp;
        <select name="state" id="state">
           <option value="">--不限状态--</option>
           <option value="1"{{if $smarty.request.state==1}} selected="selected"{{/if}}>启用</option>
           <option value="2"{{if $smarty.request.state==2}} selected="selected"{{/if}}>禁用</option>         
        </select>
        <input type="text" name="title" id="title" value="{{$smarty.request.title}}" class="input_blur">
        <input type="submit" name="button" id="button" value="==查找==" class="button_style">
    </form>
</div>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="table_list">
    <tr>
        <th>ID</th>
        <th>标题</th>
        <th>启用</th>
        <th>操作</th>
    </tr>
    {{foreach from=$topmenu item=item}}
    <tr>
        <td>{{$item.ID}}</td>
        <td class="lf">{{$item.TITLE}}</td>
        <td>{{if $item.STATE==1}}启用{{else}}禁用{{/if}}</td>
        <td> 
           <a id="GridView1_ctl02_hlkEdit" href="javascript:edit({{$item.ID}})">修改</a> | <a id="GridView1_ctl02_hlkDel" href="admin.php?ctl=sysmenu&act=del&id={{$item.ID}}">删除</a>
        </td>
    </tr>
        {{foreach from=$datamenu item=li}}
        {{if $li.PARENT_ID==$item.ID}}
        <tr>
            <td>{{$li.ID}}</td>
            <td class="lf">    &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      {{$li.TITLE}}</td>
            <td>{{if $li.STATE==1}}启用{{else}}禁用{{/if}}</td>
            <td><a id="GridView1_ctl02_hlkEdit" href="admin.php?ctl=sysmenu&act=funs&id={{$li.ID}}">功能</a> | 
               <a id="GridView1_ctl02_hlkEdit" href="javascript:edit({{$li.ID}})">修改</a> | <a id="GridView1_ctl02_hlkDel" href="admin.php?ctl=sysmenu&act=del&id={{$li.ID}}">删除</a>
            </td>
        </tr>
        {{/if}}
        {{/foreach}}
    {{/foreach}}
</table>
{{include file="admin/infoot.html"}}